package com.citywithincity.db.data2db;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.citywithincity.db.interfaces.IPsSetter;
import com.citywithincity.utils.JsonUtil;

public class Map2String implements IPsSetter  {

	@Override
	public void setValue(PreparedStatement ps, int index, Object value) throws SQLException {
		if(value == null){
			ps.setString(index,null);
		}else{
			
			String content = JsonUtil.toJson(value);
			
			ps.setString(index, content);
			
		}
	}

}
